package com.xmy.cultivate.service;

import com.xmy.cultivate.entity.CourseSchedulingDetail;
import com.xmy.cultivate.entity.Quarter;
import com.xmy.cultivate.entity.RecordCourse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.enums.StatusRecordEnum;
import com.xmy.cultivate.util.Result;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 记止课 服务类
 * </p>
 *
 * @author baomidou
 * @since 2022-08-10
 */
public interface IRecordCourseService extends IService<RecordCourse> {

    public abstract boolean batchAdd(CourseSchedulingDetail courseSchedulingDetail);

    public abstract boolean addForSchedulingId(Long courseSchedulingDetailId, Long studentId, StatusRecordEnum statusRecordEnum, Integer type);

    public abstract boolean autoRecord();

    void autoRecordAction2();

    boolean autoRecordAction(LocalDate nowLocalDate, LocalDateTime localDateTime);

    public abstract boolean recordAction(RecordCourse recordCourse);

    public abstract boolean recordActionRepair(RecordCourse recordCourse);

    public abstract boolean repairBuckleMoney(Long repairCourseId);

    @Transactional
    RecordCourse addLeaveData(Long schedulingDetailId, Long studentId, Integer buckleHouse, StatusRecordEnum status, Integer type, Integer courseType, Quarter quarterNow, Integer yearClassId);

    public abstract RecordCourse addLeaveDataForRepair(Long repairId, Long studentId, Integer buckleHouse, StatusRecordEnum status, Integer type, Integer courseType, Integer isSignIn);

    public abstract boolean pathchMoney();

    Integer getRecordCountArrive(Integer yearPart, Integer quarterNum, Long studentId, Long subjectsId);


    RecordCourse getLeaveData(Integer yearPart,
                              Integer quarterNum,
                              Integer lessonType,
                              Long studentId,
                              Long subjectsId,
                              Integer yearClassId);

    boolean greaterBuckleMoney(RecordCourse recordCourse, RecordCourse recordCourseOld);

    boolean deleteTryListenRecordCourse(Integer minusDays);

    @Transactional
    boolean backMoney(Long recordCoruseId);

    boolean disposeTimeoutNotRepair();

    Integer getMaxTaskLesson(Integer YearPart, Integer QuarterNum, String SubjectsId, Long courseVersionId, Integer categoryId);
}
